Skip to content

feat(avm)!: add immutables_hash member to get contract instance opcode#23152

Merged
IlyasRidhuan merged 1 commit into
merge-train/avmfrom
ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode
May 16, 2026
Merged

feat(avm)!: add immutables_hash member to get contract instance opcode#23152
IlyasRidhuan merged 1 commit into
merge-train/avmfrom
ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode

Conversation

@IlyasRidhuan
Copy link
Copy Markdown
Contributor

@IlyasRidhuan IlyasRidhuan commented May 11, 2026

Part 3 of the immutables_hash changes as part of AZIP-9

This updates the GETCONTRACTINSTANCE opcode so that the immutables_hash can be retrieved from the contract instance via the opcode.

Copy link
Copy Markdown
Contributor Author

IlyasRidhuan commented May 11, 2026

@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from 8e47d28 to 3ae27b1 Compare May 11, 2026 16:30
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch 2 times, most recently from f8f8953 to 9c8d4d8 Compare May 11, 2026 16:37
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch 2 times, most recently from 08ca61f to ca0212d Compare May 14, 2026 18:37
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from 9c8d4d8 to a91ac39 Compare May 14, 2026 18:37
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from ca0212d to af6ce8c Compare May 14, 2026 19:43
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch 2 times, most recently from 4311e6b to 3457e34 Compare May 14, 2026 20:37
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch 2 times, most recently from 14be1b8 to 527035c Compare May 14, 2026 21:07
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from 3457e34 to 524585d Compare May 14, 2026 21:07
@IlyasRidhuan IlyasRidhuan marked this pull request as ready for review May 15, 2026 07:46
: is_class_id ? event.retrieved_class_id
: is_init_hash ? event.retrieved_init_hash
: FF(0);
FF selected_member = is_deployer ? event.retrieved_deployer_addr
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nicer to check member_enum against ContractInstanceMember::MAX and then cast into the enum type ContractInstanceMember and using a switch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure that this would be nicer. member_enum is allowed to be > ContractInstanceMember::MAX since it's a revertible error. So the ternary is actually cleaner

Copy link
Copy Markdown
Contributor

@jeanmon jeanmon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one suggestion. Overall, it is good!

/*expectedDeployer=*/ expectContractInstance.deployer,
/*expectedClassId=*/ expectContractInstance.currentContractClassId,
/*expectedInitializationHash=*/ expectContractInstance.initializationHash,
/*expectedImmutablesHash=*/ expectContractInstance.immutablesHash,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect that you thought about the bulk test! @IlyasRidhuan

@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from 527035c to 5879a73 Compare May 15, 2026 15:15
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from 524585d to bf16019 Compare May 15, 2026 15:15
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from 5879a73 to d92bdb8 Compare May 15, 2026 20:56
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from bf16019 to 11df3f3 Compare May 15, 2026 20:56
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from d92bdb8 to bf1da80 Compare May 15, 2026 21:39
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch 2 times, most recently from de4bf52 to 582c604 Compare May 15, 2026 21:58
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from bf1da80 to 8322f9e Compare May 15, 2026 21:58
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from 8322f9e to d920b86 Compare May 16, 2026 09:01
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from 582c604 to d1ddba7 Compare May 16, 2026 09:01
Base automatically changed from ir/05-05-feat_update_address_derivation to merge-train/avm May 16, 2026 09:35
@IlyasRidhuan IlyasRidhuan requested a review from LeilaWang as a code owner May 16, 2026 09:35
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from d920b86 to 401cbaf Compare May 16, 2026 09:36
@IlyasRidhuan IlyasRidhuan merged commit a93ead2 into merge-train/avm May 16, 2026
14 checks passed
@IlyasRidhuan IlyasRidhuan deleted the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch May 16, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants